#include <iostream>
#include <cmath>
using namespace std;

bool isPerfectSquare(int num) {
    int root = static_cast<int>(sqrt(num));
    return root * root == num;
}

bool checkFateNumbers(int m, int n) {
    bool hasSolution = false;
    for (int a = m; a <= n; ++a) {
        int cubeDiff = a * a * a - (a - 1) * (a - 1) * (a - 1);
        if (isPerfectSquare(cubeDiff)) {
            int c = (int)(sqrt(cubeDiff));
            for (int b = 2; b * b < c; ++b) {
                if (b * b + (b - 1) * (b - 1) == c) {
                    cout << a << " " << b << endl;
                    hasSolution = true;
                }
            }
        }
    }
    return hasSolution;
}

int main() {
    int m, n;
    cin >> m >> n;

    if (!checkFateNumbers(m, n)) {
        cout << "No Solution" << endl;
    }

    return 0;
}    